<!DOCTYPE html>
<%@page language="java" pageEncoding="utf-8" contentType="text/html; charset=UTF-8"%>
<%@page import = "java.util.*,cn.nawang.ebeim.api.domain.User"%>
<%
	String ctx = request.getContextPath();
%>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>新增终端</title>
    <link rel="stylesheet" type="text/css" href="css/basic.css">
    <link rel="stylesheet" type="text/css" href="css/common.css">
    <link rel="stylesheet" type="text/css" href="css/ui.css">
    <link rel="stylesheet" type="text/css" href="css/g.css">
    <!-- 设置JS全局变量  ctx -->
	<script type="text/javascript">
		var ctx = "<%=request.getContextPath()%>";
		<%
		String sessUserName = "";
		HttpSession Session = request.getSession();
		User sessStr = (User)Session.getAttribute("user");
		if(sessStr != null ){
		  sessUserName = sessStr.getName();
		}
		%>
		
		
		
	</script>
</head>
<body>
    <jsp:include page="head.jsp"></jsp:include>
    <div class="container">
    <jsp:include page="terminal_left.jsp"></jsp:include>
        <div class="page-content">
            <div id="content-scroll">
                <div class="cont-area clearfix">
                    <i class="fl"></i><span class="fl">首页&gt;终端列表&gt;新增终端</span>
                </div>
                <div class="form-page">
                    <form>
                        <div class="form-block">
                            <h2>基本信息</h2>
                            <div class="row clearfix">
                                <div class="col fl">
                                    <label>终端名称：</label>
                                    <input class="required" type="text" name="name">
                                    <span class="message msg-tip"><em></em><i>请输入终端名称</i></span>
                                </div>
                                <div class="col fl">
                                    <label>CA编号：</label>
                                    <select name="caId" id="j-caId">
                                    </select>
                                    <a href="javascript:;" class="j-whatCa">什么是CA编号</a>
                                </div>
                            </div>
                            <div class="row clearfix">
                                <div class="col fl">
                                    <label>创建人员：</label>
                                    <span class="j-thisUser"><%= sessUserName %></span>
                                </div>
                                <div class="col fl">
                                    <label>登记时间：</label>
                                    <span class="j-date"></span>
                                </div>
                            </div>
                            <div class="row clearfix">
                                <label>空间大小：</label>
                                <input class="required" type="text" name="spaceSize" id="j-spaceSize" data-maxstorage="">G
                                <a href="javascript:;" class="j-watchSize">查看可分配空间</a>
                                <span class="message msg-tip"><em></em><i>请输入要分配的空间大小</i></span>
                            </div>
                            <div class="row g-mt20 clearfix">
                                <label class="vertical-top">终端描述：</label>
                                <textarea class="required" name="description"></textarea>
                                <span class="message msg-tip"><em></em><i>请输入终端描述</i></span>
                            </div>
                        </div>
                        <div class="form-block">
                            <h2>安全策略</h2>
                            <div class="row clearfix">
                                <div class="check-group">
                                    <input type="checkbox" name="isEncryptSrc" id="j-isEncryptSrc" value="1">
                                    <span>加密备份源文件</span>
                                </div>
                                <div class="radio-group j-radio">
                                    <input type="radio" checked="checked">AES
                                    <a href="javascript:;" class="j-whatEncrypt">了解加密算法</a>
                                    <a href="javascript:;" class="j-whatFile">关于证书文件</a>
                                </div>
                            </div>
                            <div class="row clearfix">
                                <div class="check-group">
                                    <input type="checkbox" name="isRecordChange" value="1">
                                    <span>是否记录文件变动轨迹</span>
                                </div>
                                <div class="check-group">
                                    <input type="checkbox" name="isSinatureSrc" value="1">
                                    <span>启用文件防篡改功能（文件安全签名）</span>
                                </div>
                                <div class="check-group">
                                    <input type="checkbox" name="isOpenSsl" value="1">
                                    <span>启用网络安全传输（SSL）</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-block">
                            <h2>预警策略设置</h2>
                            <div class="row clearfix">
                                <label class="vertical-top fl">预警事件：</label>
                                <div class="fl">
                                    <div class="check-group">
                                        <input type="checkbox" checked="checked" name="alertOffline" value="1">
                                        <span>终端离线时间超过1小时 </span>
                                    </div>
                                    <div class="check-group">
                                        <input type="checkbox" checked="checked" name="alertTaskError" value="1">
                                        <span>灾备任务执行异常</span>
                                    </div>
                                    <div class="check-group">
                                        <input type="checkbox" checked="checked" name="alertDsError" value="1">
                                        <span>终端数据源异常 </span>
                                    </div>
                                    <div class="check-group">
                                        <input type="checkbox" checked="checked" name="alertLicenseOverTime" value="1">
                                        <span>终端授权近效期</span>
                                    </div>
                                    <div class="check-group">
                                        <input type="checkbox" checked="checked" name="alertSpaceLack" value="1">
                                        <span>购买存储空间不足</span>
                                    </div>
                                </div>
                            </div>
                            <div class="row clearfix">
                                <label>预警方式：</label>
                                <select name="alertType">
                                    <option value="0">邮件通知</option>
                                    <option value="1">短信通知</option>
                                    <option value="2">邮件和短信通知</option>
                                </select>
                            </div>
                            <div class="row clearfix">
                                <label>预警人员：</label>
                                <input type="hidden" name="alertUser" value="" id="j-alertsId">
                                <a href="javascript:;" id="j-alertUserBtn">新增</a>
                            </div>
                            <div class="row j-alertUser">
                                <table>
                                    <thead>
                                        <tr>
                                            <th width="100">人员姓名</th>
                                            <th width="100">电子邮件</th>
                                            <th width="100">移动电话</th>
                                            <th width="100">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody id="j-alertUserList">
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="form-block">
                            <h2>管理权限设置</h2>
                            <div class="row clearfix">
                                <label>授权人员：</label>
                                <input type="hidden" name="authorizationUser" value="" id="j-autsId">
                                <a href="javascript:;" id="j-autUserBtn">新增</a>
                            </div>
                            <div class="row j-authorizationUser">
                                <table>
                                    <thead>
                                        <tr>
                                            <th width="100">人员姓名</th>
                                            <th width="100">电子邮件</th>
                                            <th width="100">移动电话</th>
                                            <th width="100">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody id="j-autUserList">
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="btns-group">
                            <div class="row">
                                <button class="btn" type="button" id="j-addBtn">添加</button>
                                <button class="btn" type="button" id="j-resetBtn">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script type="text/ysmart" data-name="spaceSizeTpl">
        <div class="dialog-desc g-mb15">
            <p>总空间大小：100 G；目前可分配空间大小：空间不足。</p>
        </div>
        <div class="dialog-table g-mb10">
            <table>
                <thead>
                    <tr>
                        <th>终端名称</th>
                        <th>创建时间</th>
                        <th>分配大小</th>
                        <th>使用大小</th>
                        <th>可用大小</th>
                    </tr>
                </thead>
                <tbody>
                    <@ yepjs.isArray(DATA) && yepjs.forEach(DATA, function(item, index){ @>
                    <tr>
                        <td><@=item.name @></td>
                        <td><@=item.createTimeStr @></td>
                        <td><@=item.spaceSize @></td>
                        <td><@=item.usedSpaceSize @></td>
                        <td><@=item.restSpaceSize @></td>
                    </tr>
                    <@ }); @>
                </tbody>
            </table>
        </div>
    </script>
    <script type="text/ysmart" data-name="userTpl">
        <div class="dialog-table g-mb10">
            <table id="j-list">
                <thead>
                    <tr>
                        <th width="24px"><input class="j-checkAll" type="checkbox"></th>
                        <th width="150px">人员姓名</th>
                        <th width="150px">电子邮件</th>
                        <th width="150px">移动电话</th>
                        <th width="150px">所属机构</th>
                    </tr>
                </thead>
                <tbody id = "j-userList">
                    <@ yepjs.isArray(DATA) && yepjs.forEach(DATA, function(item, index){ @>
                    <tr data-id="<@=item.id @>">
                        <td><input type="checkbox" data-id="<@=item.id @>" class="j-checkEach" /></td>
                        <td class="tb-name"><@=item.name @></td>
                        <td class="tb-email"><@=item.email @></td>
                        <td class="tb-mobile"><@=item.mobile @></td>
                        <td><@=item.departName @></td>
                    </tr>
                    <@ }); @>
                </tbody>
            </table>
            <div class="dom-page g-mt15 clearfix" id="j-userPage">
                <div class="page-left fl"><span>显示10条，共<span id="j-userTotalNum">0</span>条</span></div>
                <div class="page-right fr">
                    <a href="javascript:;" class="j-page-first">首页</a>
                    <a href="javascript:;" class="j-page-prev">上一页</a>
                    <span>第<input type="text" value="1" class="j-page-cur">页，共<span class="j-page-totalPage">1</span>页</span>
                    <a href="javascript:;" class="j-page-next">下一页</a>
                    <a href="javascript:;" class="j-page-last">尾页</a>
                </div>
            </div>
        </div>
    </script>
    <script type="text/ysmart" data-name="userListTpl">
        <@ yepjs.isArray(DATA) && yepjs.forEach(DATA, function(item, index){ @>
        <tr data-id="<@=item.id @>">
            <td><input type="checkbox" data-id="<@=item.id @>" class="j-checkEach" /></td>
            <td class="tb-name"><@=item.name @></td>
            <td class="tb-email"><@=item.email @></td>
            <td class="tb-mobile"><@=item.mobile @></td>
            <td><@=item.departName @></td>
        </tr>
        <@ }); @>
    </script>
    <script src="js/yep.min.js" type="text/javascript" data-config="YBA.Config.js"></script>
    <script src="js/common.js" type="text/javascript"></script>
    <script type="text/javascript">
        yepjs.use({
            name: ["jquery", "YBA.Plugin.slimscroll","YBA.Common","YBA.Plugin.wdatePicker"],
            callback: function () {
                $('#side-scroll').slimscroll({
                    height:"100%"
                });
                YBA.Common.sidebar();
            }
        });
        yepjs.use({
            name: "YBA.Logic.Terminal.add",
            callback: function () {
                YBA.Logic.Terminal.add();
            }
        });
    </script>
</body>
</html>
